@mixin utils-ellipsis($line: 1) {
    @if $line == 1 {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    } @else {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: #{$line};
        overflow: hidden;
    }
}

@mixin flex($justify-content: center, $align-items: center) {
    display: flex;
    align-items: $align-items;
    justify-content: $justify-content;
}

@mixin scrollbar_base($bg) {
    &::-webkit-scrollbar-track {
        background-color: transparent;
    }

    &::-webkit-scrollbar-thumb {
        background: $bg;
        border-radius: 4px;
    }
}

@mixin scrollbar_y($width: var(--q-scrollbar-width), $bg: transparent) {
    /* 垂直滚动条 */
    &::-webkit-scrollbar {
        width: $width;
    }

    @include scrollbar_base($bg);
}

@mixin scrollbar_x($height: var(--q-scrollbar-height), $bg: transparent) {
    /* 水平滚动条 */
    &::-webkit-scrollbar {
        height: $height;
    }

    @include scrollbar_base($bg);
}

@mixin scrollbar_hover() {
    &:hover {
        &::-webkit-scrollbar-thumb {
            background: var(--q-bg-scrollbar-thumb);
        }

        &::-webkit-scrollbar-thumb:hover {
            background: var(--q-bg-scrollbar-thumb-hover);
        }
    }
}

/* 全局禁用提示 */
@mixin disabled-tooltip() {
    .row-disabled {
        position: relative;
        cursor: not-allowed;

        &:hover {
            &::after {
                position: absolute;
                // top: 8px;
                top: 0;
                left: -5px;
                z-index: 9999;
                width: 55px;
                height: 100%;
                content: '';
                background: url('@/assets/img/tip.svg') no-repeat center;
                background-size: 100% 100%;
            }
        }
    }
}
